using System.Collections.Generic;
using OracleInternal.SqlAndPlsqlParser.LocalParsing;

namespace OracleInternal.SqlAndPlsqlParser.RuleProcessors.ODPCommands
{
	internal static class OracleMbEarleyScalarSubqueryExpressionRuleMultiProcessors
	{
		public static OracleMbEarleyRuleMultiProcessorAddItem[] s_vRuleProcessorItems;

		static OracleMbEarleyScalarSubqueryExpressionRuleMultiProcessors()
		{
			s_vRuleProcessorItems = new OracleMbEarleyRuleMultiProcessorAddItem[1]
			{
				new OracleMbEarleyRuleMultiProcessorAddItem
				{
					m_vHeadSymbol = "scalar_subquery_expression",
					m_vRHSSymbols = new string[3]
					{
						"'('",
						"subquery",
						"')'"
					},
					m_vRuleProcessor = Process_ScalarSubqueryExpression_LEFT_PARENTHESIS_Subquery_RIGHT_PARENTHESIS_Rule,
					m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
				}
			};
		}

		public static object Process_ScalarSubqueryExpression_LEFT_PARENTHESIS_Subquery_RIGHT_PARENTHESIS_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			OracleLpScalarSubqueryExpression oracleLpScalarSubqueryExpression = new OracleLpScalarSubqueryExpression(null);
			List<ParseNode> list = ctx.CurrentParseNode.Children();
			OracleMbEarleyRuleMultiProcessorTable ruleProcessorTable = ctx.RuleProcessorTable;
			ctx.RuleProcessorTable = ctx.GetRuleProcessorTable("select");
			object obj = OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(list[1], 0, -1, ctx);
			ctx.RuleProcessorTable = ruleProcessorTable;
			oracleLpScalarSubqueryExpression.Subquery = obj as OracleLpSubquery;
			return oracleLpScalarSubqueryExpression;
		}
	}
}
